home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************/
- /* */
- /* Include - 4th Class.h */
- /* Author - Alexander S. Colwell, Copyright © 1990 */
- /* */
- /* Revision - None. */
- /* */
- /************************************************************************/
-
- #ifndef _4thClass_ /* Check if has not been included */
- #define _4thClass_ /* Mark this file included */
-
- /* Compilation parameters */
- #define ExtArea /* Mark debugging external area */
-
-
- #ifndef _4thDefs_ /* Check if has not been included */
- #include "4thDefs.h" /* Include this file */
- #endif
-
- #include <oops.h> /* OOPS defs */
- #include <Color.h> /* Color defs */
-
- #ifndef DbgExtArea /* Check if not debugging ext area */
- #ifdef ExtArea /* Check if it's real external area */
- #include <SetupA4.h> /* Setup Register A4 defs */
- #define DbgPrint DummyProc /* Dummy procedure */
-
- #else /* Nope, we've debugging */
- #define main C4thMain /* Re-define main entry procedure */
- #define RememberA4() DummyProc()
- #define RememberA0() DummyProc()
- #define SetUpA4() DummyProc()
- #define RestoreA4() DummyProc()
- #define DbgPrint ((CDbgPane *)(gApplication->dbgDoc->itsMainPane))->DoPrint
- #endif
- #endif
-
- /* Trap definitions */
- #define SysEnvironsTrap 0xa090 /* System Enviorment trap */
- #define GetDeviceListTrap 0xaa29 /* Graphics Device trap */
- #define UnknownTrap 0xa89f /* Unknown trap instruction */
-
- /* Mac ROM ID's */
- #define macIIROM 0x0078 /* Mac II ROM ID */
- #define macSEROM 0x0076 /* Mac SE ROM ID */
- #define macPlusROM 0x0075 /* Mac Plus ROM ID */
- #define macROM 0x0069 /* Original Mac ROM ID */
-
- extern RGBColor HiliteRGB : 0xda0; /* Hilite's RGB color */
-
- #ifndef NULL /* Check if "NULL" is not defined */
- #define NULL (0L) /* Define "NULL" constant */
- #endif
-
- /* Macro functions */
- #define abs(a) (a<0?-a:a) /* Absolute value */
- #define min(a,b) (a<b?a:b) /* Minimum value */
- #define max(a,b) (a<b?b:a) /* Maximum value */
-
- struct C4th : indirect { /* 4th object data structure */
-
- /* Variable instances */
- WindowPtr wPtr; /* External Area window pointer */
- short layout; /* Layout flag indicator */
- short dirty; /* Dirty flag indicator */
- short active; /* Active flag indicator */
- short keyBoardEvents; /* Using keyboard events */
- char *name; /* External area name string pointer*/
- EventRecord *event; /* External area event pointer */
- Rect drawArea; /* External drawing area */
- Rect prevArea; /* Previous external drawing area */
- short width; /* External area width */
- short height; /* External area height */
-
- /* System variable definitions */
- SysEnvRec sysEnv; /* System configuration */
- short originalMac; /* Using orignal 128K/512K Macs */
- short hasGraphicDevices;/* Using graphic devices */
-
- /* Working variable definitions */
- PenState savePenState; /* Save current pen states */
- short saveFont; /* Save current font's ID */
- short saveSize; /* Save current font's size */
- Style saveStyle; /* Save current font's style */
- short saveMode; /* Save current font's mode */
- RgnHandle tmpRgn; /* Temporary region */
-
- /* Method instances */
- void Message(void); /* Dispatch message */
- void IExtArea(short);/* Initialization message */
- void Close(void); /* Close message */
- void Idle(void); /* Idle message */
- void Cursor(Point); /* Cursor message */
- void Select(void); /* Activate message */
- void Deselect(void); /* Deactivate message */
- void Scroll(void); /* Scroll message */
- void Draw(void); /* Draw message */
- void DoClick(Point,short,long);/* Mouse message */
- void DoKeyDown(char,Byte);/* Key message */
- void DoUndo(void); /* Edit "Undo" message */
- void DoCut(void); /* Edit "Cut" message */
- void DoCopy(void); /* Edit "Copy" message */
- void DoPaste(void); /* Edit "Paste" message */
- void DoClear(void); /* Edit "Clear" message */
- void DoSelectAll(void);/* Edit "Select All" message */
- void SaveStates(void);/* Save drawing states */
- void RestoreStates(void);/* Restore drawing states */
- short TrackMouse(Point,RgnHandle);/* Track da mouse */
- short UsingColor(void);/* Check if using color */
- };
-
- #endif
-